import com.chen.ExcelApplication;
import com.chen.service.SysUserService;
import com.chen.service.TestServie;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;


@SpringBootTest(classes = ExcelApplication.class)
@RunWith(SpringRunner.class)
public class insertData {

    @Resource
    private SysUserService SysUserService;

    @Resource
    private TestServie testServie;

    @Test
    public void add (){
        int i = 0;
       while (i < 1000){
           SysUserService.insertBatch(testServie.test());
           i++;
           System.out.println("第"+i+"次执行");
           try {
               Thread.sleep(1000);
           } catch (InterruptedException e) {
              throw new RuntimeException("第" + i + "次执行失败");
           }
       }
    }


}
